/*
 * @Author: xiaxia
 * @Description: 
 * @Date: 2024-06-26 12:01:02
 * @LastEditTime: 2024-07-03 16:01:31
 * @FilePath: \project\src\api\product\sku\index.ts
 */
import request from '@/utils/request';
import { SkuInfoRespones, SkuLitsRespones } from './type';

enum API {
  GETSKULIST_URL = '/admin/product/list/', // 所有的 sku 商品
  CANCLESALESKU_URL = '/admin/product/cancelSale/', // 下架
  ONSALESKU_URL = '/admin/product/onSale/', // 上架
  SKUDETAIL_URL = '/admin/product/getSkuInfo/', // sku商品详情
  SKUDELETE_URL = '/admin/product/deleteSku/', //  删除sku
}

export const reqSkuLits = (page:number, limit:number) => request.get<any, SkuLitsRespones>(API.GETSKULIST_URL+`${page}/${limit}`)
export const reqOnSale = (skuId:number) => request.get<any, any>(API.ONSALESKU_URL+skuId)
export const reqCancleSale = (skuId:number) => request.get<any, any>(API.CANCLESALESKU_URL+skuId)
export const reqSkuDetail = (skuId:number) => request.get<any, SkuInfoRespones>(API.SKUDETAIL_URL+skuId)
export const reqSkuDelete = (skuId:number) => request.delete<any, any>(API.SKUDELETE_URL+skuId)
